<template>
  <div class="wai">
    <div class="zong">
      <div class="top">
        <h1>停车区域分布图</h1>
        <div>
          <b>●<span>已接入</span></b> <b>●<span>待接入</span></b>
        </div>
      </div>
      <ul class="rightt">
        <li>
          <p>芙蓉区</p>
          <img src="../../../../public/首页智慧停车/1.png" alt="" />
          <div>
            <span>已接入<br />117</span>
            <div></div>
            <span>待接入<br />303</span>
          </div>
        </li>
        <li>
          <p>开福区</p>
          <img src="../../../../public/首页智慧停车/1.png" alt="" />
          <div>
            <span>已接入<br />117</span>
            <div></div>
            <span>待接入<br />542</span>
          </div>
        </li>
        <li>
          <p>关心区</p>
          <img src="../../../../public/首页智慧停车/2.png" alt="" />
          <div>
            <span>已接入<br />465</span>
            <div></div>
            <span>待接入<br />485</span>
          </div>
        </li>
        <li>
          <p>雨花区</p>
          <img src="../../../../public/首页智慧停车/3.png" alt="" />
          <div>
            <span>已接入<br />212</span>
            <div></div>
            <span>待接入<br />117</span>
          </div>
        </li>
        <li>
          <p>岳麓区</p>
          <img src="../../../../public/首页智慧停车/4.png" alt="" />
          <div>
            <span>已接入<br />353</span>
            <div></div>
            <span>待接入<br />724</span>
          </div>
        </li>
        <li>
          <p>其他区</p>
          <img src="../../../../public/首页智慧停车/5.png" alt="" />
          <div>
            <span>已接入<br />147</span>
            <div></div>
            <span>待接入<br />243</span>
          </div>
        </li>
      </ul>
    </div>
    <div
      id="mian"
      style="
        width: 391px;
        height: 280px;
        margin-left: 30px;
        border-radius: 8px;
        background-color: #fff;
      "
    ></div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  mounted() {
    this.initEchart();
  },
  methods: {
    initEchart() {
      var myecart = echarts.init(document.getElementById("mian"));
      myecart.setOption({
        title: {
          text: "停车场今日区域消费图",
          subtext: "2018年4月10日",
          padding: 16,
          subtextStyle: {
            color: "#6963b9",
          },
          itemGap: 6,
          textStyle: {
            fontSize: 18,
          },
        },
        xAxis: {
          type: "category",
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
              color: "#ccc",
            },
          },
          data: ["芙蓉区", "开福区", "关心区", "雨花区", "岳麓区", "其他区"],
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            color: "#b2b2b2",
          },
        },
        yAxis: {
          type: "value",
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
              color: "#ccc",
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            color: "#2f2f2f",
          },
          data: [0, 2265, 5530, 8295, 11061],
        },
        grid: {
          left: "2%",
          right: "5%",
          bottom: "1%",
          containLabel: true,
        },
        series: [
          {
            data: [11061, 10368, 9904, 9719, 7342, 350],
            type: "bar",
            itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: "#188df0" },
                { offset: 0.5, color: "#83bff6" },
                { offset: 1, color: "#83bff6" },
              ]),
            },
          },
        ],
      });
    },
  },
};
</script>

<style lang="less" scoped>
.wai {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}
.zong { 
  border-radius: 8px;
  height: 280px;
  width: 805px;
  background-color: #fff;
}
.top {
  height: 76px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
}
h1 {
  font-size: 18px;
  height: 76px;
  box-sizing: border-box;
  padding-top: 18px;
  font-weight: 700;
}
b {
  font-size: 18px;
  line-height: 76px;
  span {
    font-size: 10px;
    line-height: 18px;
    padding: 0 20px 0 14px;
  }
}
div & > b:nth-child(1) {
  color: #48b8de;
}
div & > b:nth-child(2) {
  color: #474197;
  padding-right: 0px;
}
.rightt {
  height: 40px;
  display: flex;
  justify-content: space-between;
  li {
    flex: 1;
    text-align: center;
    p {
      line-height: 40px;
      font-size: 14px;
    }
    img {
      height: 80px;
      padding: 10px 0;
    }
    div {
      font-size: 8px;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      div & > span:nth-child(1) {
        color: #86cbe8;
      }
      div & > span:nth-child(3) {
        color: #b2b0c8;
      }
      div {
        width: 2px;
        height: 12px;
        box-sizing: border-box;
        padding-top: 15px;
        background-color: #474197;
      }
    }
  }
}
.man {
  flex: 1;
  margin-left: 30px;
  border-radius: 8px;
  background-color: #474197;
}
</style>
